using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

[assembly: WebResource("VeryCodes.Controls.Web.PageTitleTips.js", "text/javascript")]
[assembly: WebResource("VeryCodes.Controls.Web.PageTitleTips.css", "text/css")]
namespace VeryCodes.Controls.Web
{
    [ToolboxData("<{0}:PageTitleTips runat=server></{0}:PageTitleTips>")]
    [Designer(typeof(VeryCodes.Controls.Web.PageTitleTipsDesigner))]
    public class PageTitleTips : Control
    {
        protected override void OnLoad(EventArgs e)
        {
            string cssUrl = Page.ClientScript.GetWebResourceUrl(this.GetType(), "VeryCodes.Controls.Web.PageTitleTips.css");
            HtmlLink cssLink = new HtmlLink();
            cssLink.Href = cssUrl;
            cssLink.Attributes.Add("rel", "stylesheet");
            cssLink.Attributes.Add("type", "text/css");
            Page.Header.Controls.Add(cssLink);

            string JSUrlStr = Page.ClientScript.GetWebResourceUrl(this.GetType(), "VeryCodes.Controls.Web.PageTitleTips.js");
            Page.Header.Controls.Add(new LiteralControl("<script type=\"text/javascript\" src=\"" + JSUrlStr + "\" charset=\"gb2312\"></script>"));

            //Page.ClientScript.RegisterClientScriptResource(this.GetType(), "VeryCodes.Controls.Web.PageTitleTips.js");
        }

    }
}
